#!/bin/bash

CP="lib/jewelcli-0.6.jar:lib/libthrift.jar:thrift/gen-java.jar:lib/slf4j-api-1.5.8.jar:lib/slf4j-simple-1.5.8.jar:lib/org-netbeans-swing-outline.jar:lib/tightvnc.jar:bin/:lib/jedis-1.5.2.jar:lib/commons-pool-1.5.5.jar"
DECKLINK_CP=:magiclib/magiclib.jar:magiclib/jna.jar
DECKLINK_JNA=-Djna.library.path=magiclib
DECKLINK_PATH=-Djava.library.path=magiclib

if [ "$1" == "build" ]; then
  mkdir -p bin
  javac -d bin -sourcepath src -cp "$CP" $(find src -name '*.java')
else
  java -Xmx1000m $JVM_ARGS -cp "$CP$DECKLINK_CP" $DECKLINK_JNA $DECKLINK_PATH se.kth.livetech.contest.feeder.FeedTool "$@"
fi
